package com.gyms.view;

import android.content.Context;
import android.content.Intent;
import android.text.style.ClickableSpan;
import android.view.View;

import com.gyms.activity.WebViewActivity;
import com.gyms.constant.Constants;

/**
 * Created by ltx on 17/8/30
 * 链接 url 跳转点击
 */

public class CustomUrlSpan extends ClickableSpan {
    private String url;
    private Context mContext;
    public CustomUrlSpan(Context mContext, String url){
        this.url = url;
        this.mContext=mContext;
    }
    @Override
    public void onClick(View widget) {
        Intent mIntent =new Intent(mContext, WebViewActivity.class);
        mIntent.putExtra(Constants.S_KEY_URL, url);
        mContext.startActivity(mIntent);
    }
}
